try:
    f=open('myfile.txt')
    print(f.read())
except OSError:
    print('出错啦')
finally:
    if 'f' in locals():
        f.close()
